<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\web\NotFoundHttpException;

//chỉ admin mới có quyền
if(Yii::$app->user->isGuest || Yii::$app->user->identity->acc_type!=0)
{
	throw new NotFoundHttpException('The requested page does not exist.');
}
else
{

	/* @var $this yii\web\View */
	/* @var $searchModel app\models\TestAccountSearch */
	/* @var $dataProvider yii\data\ActiveDataProvider */

	$this->title = 'Test Accounts';
	//$this->params['breadcrumbs'][] = $this->title;
	?>
	<div class="test-account-index">

		<h1><?= Html::encode($this->title) ?></h1>
		<?php // echo $this->render('_search', ['model' => $searchModel]); ?>

		<p>
			<?= Html::a('Thêm tài khoản test mới', ['create', 'pro_id'=>$pro_id], ['class' => 'btn btn-success']) ?>
		</p>

		<?= GridView::widget([
			'dataProvider' => $dataProvider,
			'filterModel' => $searchModel,
			'columns' => [
				['class' => 'yii\grid\SerialColumn'],

				//'id',
				'name',
				'password',
				//'pro_id',
				'pro.name',

				['class' => 'yii\grid\ActionColumn'],
			],
		]); ?>

	</div>
<?php
}
?>
